#ifndef _LOGIN_H
#define _LOGIN_H
#include "xSingleton.h"
#include <vector>
#include "xTCPTask.h"
#include <mutex>
using namespace xNet;
class Login
{
public:
    friend class Singleton<Login>;
    Login();
    ~Login();
    void Update(uint32_t diff);
    void AddSession(xTCPTask* task);
private:
    typedef std::vector<xTCPTask*> LoginTaskContainer;
    LoginTaskContainer m_addLoginTasks;
    LoginTaskContainer m_globalLoginTasks;
    typedef std::mutex LoginSessionMutex;
    LoginSessionMutex m_sessionMutex;
};

#define LoginMgr Singleton<Login>::getInstance()
#endif